package net.huashitong.ssydt.provider.money.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.huashitong.ssydt.PaginationResult;
import net.huashitong.ssydt.money.entity.SsMoneyOrder;
import net.huashitong.ssydt.money.entity.vo.SsMoneyOrderQueryInVO;
import net.huashitong.ssydt.provider.money.service.SsMoneyOrderService;
import net.huashitong.ssydt.provider.web.model.Result;
import net.huashitong.ssydt.provider.web.utils.ResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author hemj
 * @version 2017/8/18
 */
@Api(value = "/money/order", tags = {"订单管理（后台）"})
@RestController
@RequestMapping("/money/order")
public class SsMoneyOrderController {
	@Autowired
	private SsMoneyOrderService ssMoneyOrderService;

	@ApiOperation(value = "获取订单信息", notes = "根据订单ID获取订单信息")
	@GetMapping("/{orderId}")
	public Result<SsMoneyOrder> get(@PathVariable("orderId") String orderId) {
		return ResultUtils.getSuccessResults(ssMoneyOrderService.getByOrderId(orderId));
	}

	@ApiOperation(value = "订单列表", notes = "订单列表")
	@GetMapping
	public Result<PaginationResult<SsMoneyOrder>> paginationQuery(@ModelAttribute SsMoneyOrderQueryInVO ssMoneyOrderQueryInVO) {
		return ResultUtils.getSuccessResults(ssMoneyOrderService.paginationQuery(ssMoneyOrderQueryInVO));
	}

}
